﻿//自定义保存
var fnCustomSave = function () {
    var form = new mini.Form("form1");
    form.validate();
    if (!form.isValid()) return;
    var form_data = form.getData();
    fnClone(form_data, instance);
    if (typeof (instance) != "undefined" && instance != null) {
        if (form_data.user_type == 1)
        {
            var employee = fnGetSingleData("t_base_employee", "id='" + form_data.employee_id+ "'");
            instance.name = employee[0].name;
        }
        var json = mini.encode(instance);   //序列化成JSON  基本信息
        $.ajax({
            url: "/extendpage/action/datasave.aspx?entity=t_sys_user&flag=1&action=mutibatchsave",
            type: "post",
            data: { data: json},
            cache: false,
            success: function (text) {
                if (text == 1) {
                    alert("数据保存成功!")
                    fnClose();

                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert(jqXHR.responseText);
            }
        });
    }
}